package com.example.web.websystem.service;

import com.example.web.websystem.dao.SysAdministratorSettingDao;
import com.example.web.websystem.dao.model.SysAdministratorSettingDO;
import com.example.web.websystem.dao.model.SysRoleDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * Created by YangGang on 2021/9/15 11:38。
 */
@Service
public class SysAdministratorSettingService {
    @Autowired
    private SysAdministratorSettingDao sysAdministratorSettingDao;


    /**
     * 查询-系统设置
     *
     * @return
     */
    @Cacheable("getAdministratorSetting")
    public SysAdministratorSettingDO getAdministratorSetting() {
        return sysAdministratorSettingDao.select();
    }

    /**
     * 更新-系统的openPaths
     *
     * @param openPaths
     * @return
     */
    @CacheEvict(value = "getAdministratorSetting", allEntries = true)
    public int updateOpenPaths(String openPaths) {
        return sysAdministratorSettingDao.updateOpenPaths(openPaths);
    }



}
